import { requestApi } from "../request";

export const payApi = {
  initiateWeChatPay(orderData) {
    return new Promise(async (resolve, reject) => {
      return requestApi({
        url: "/api/wechat-pay/order",
        method: "POST",
        data: orderData,
      })
        .then((result: any) => {
          const data = result.data.data;
          resolve(data);
        })
        .catch((error) => {
          reject(error);
        });
    });
  },
};
